<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh" lang="zh">
<head>
<title><%= title %> - THSCSLab</title>
<% include style_script.html %>
</head>
<body>
<!-- Wrap -->
<div id="wrap"> 
        <!-- Header -->
        <% include header.html %>
        <!--Content Wrap -->
        <div id="content-wrap">
            <div id="main">
                <h1>Description</h1>
                <p id="description"><%- description %></p>
                <p class="post-footer">
                    <span class="date">发布日期：<span id="post_time"><%- post_date %></span></span>
                    <span class="comments">文章作者：<span id="author"><%- author %></span></span>
                </p>
                <%- main_html %>
            </div>
            <script type="application/javascript">
                var ctx = location.origin;
                $("div#main").ready(function () {
                    $('pre code').each(function(_, block) {
                        hljs.highlightBlock(block);
                    });
                });
            </script>
            <div id="sidebar" style="margin-top: 10px;">
                    <h1>文章目录</h1>
                    <ul class="sidemenu" id="sides">
                    <noscript style="margin-left: 5px;">JavaScript code support is required.</noscript>
                    </ul>
            </div>
        <!--End content-wrap-->
        </div>
        <!-- Footer -->
        <% include footer.html %>
<!-- END Wrap -->
</div>
<script>
    function slideMenu () {
        var y = window.pageYOffset;
        var bar = document.getElementById("sidebar");
        bar.style = "margin-top: " + (10 - y > -120 ? 10 - y : -120) + "px";
    }
    window.addEventListener("scroll", slideMenu);
    $("#logout").click(function () {
        $.post("/logout", {}, function () {
            location.reload();
        });
    });
</script>
</body>
</html>
